package com.anhry.www.safety.manage.djpd.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.anhry.www.safety.manage.djpd.bean.TbDjpdApplyWs1;
import com.anhry.www.safety.manage.djpd.bean.TbDjpdApplyWs2;
import com.anhry.www.safety.manage.djpd.service.DjpdService;
import com.anhry.www.safety.util.dao.UtilDao;

/**
 * @date:2012-11-1
 * @remark:
 * @author:dongbin
 */
@Service
@SuppressWarnings("unchecked")
public class DjpdServiceImpl implements DjpdService{
	
	@Resource
	private UtilDao utilDao;

	public UtilDao getUtilDao() {
		return utilDao;
	}

	public void setUtilDao(UtilDao utilDao) {
		this.utilDao = utilDao;
	}

	public TbDjpdApplyWs1 getDjpdWs1(String appId) throws Exception {
		List list = (List)this.utilDao.getHqlQuery("from TbDjpdApplyWs1 t where 1=1 and t.applyId="+appId);
		if(null!=list && list.size()>0){
			return (TbDjpdApplyWs1)list.get(0);
		}
		return null;
	}

	public TbDjpdApplyWs2 getDjpdWs2(String appId) throws Exception {
		List list = (List)this.utilDao.getHqlQuery("from TbDjpdApplyWs2 t where 1=1 and t.applyId="+appId);
		if(null!=list && list.size()>0){
			return (TbDjpdApplyWs2)list.get(0);
		}
		return null;
	}

}
